home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 52
/
Amiga Format AFCD52 (Issue 136, May 2000).iso
/
-screenplay-
/
hd_installers
/
whdidemos
/
andromeda_sequential.lha
/
sequential-hd
/
Install
next >
Wrap
Text File
|
1998-07-09
|
4KB
|
184 lines
;----------------------------
; BJ (20.06.96)(05.09.96)
; tabsize=4
;----------------------------
;****************************
(set #readme-file "README") ;name of readme file
(set #CI_drive "DF0:") ;default source drive
(set #cleanup "") ;files to delete after install
(set #last-disk 1) ;amount of disks
;****************************
;----------------------------
; Checks if given program is reachable via the path
; parameters:
; #program - to check
; result:
; #instok - 0 if not found
(procedure P_chkinst
(if
(= 0 (run ("cd SYS:\nWhich %s" #program)))
(set #instok 1)
(set #instok 0)
)
)
;----------------------------
; Checks if given program is reachable via the path
; if not reachable tries to install from local to RAM:
; if fails abort install
; parameters:
; #program - to check
(procedure P_chkrun
(P_chkinst)
(if
(= #instok 0)
(
(if
(exists #program)
(copyfiles
(help @copyfiles-help)
(source #program)
(dest "RAM:") ;should always be in the path
)
(if
(exists ("//c/%s" #program)) ;on installation package
(copyfiles
(help @copyfiles-help)
(source ("//c/%s" #program))
(dest "RAM:") ;should always be in the path
)
(abort ("You must install %s first !" #program))
)
)
(set #cleanup ("RAM:%s %s" #program #cleanup))
)
)
)
;----------------------------
; Create disk-Image
; parameters:
; #dest - DestinationPath
; #CI_diskname - DiskName
; #CI_diskno - DiskNumber
; #CI_drive - DriveToReadFrom
(procedure P_image
(message ("\nInsert \"%s\" into drive %s !\n\n(make sure it is the right disk because it will not be checked)" #CI_diskname #CI_drive))
(if
(= 0 (run ("cd \"%s\"\npath RAM: ADD\nDIC %s FD=%ld LD=%ld >con:///1000//CLOSE" #dest #CI_drive #CI_diskno #CI_diskno)))
("")
(abort "\"DIC\" has failed to create this diskimage")
)
)
;****************************
; check if WHDLoad is installed
(set #program "WHDLoad")
(P_chkinst)
(if
(= #instok 0)
(abort "You must install WHDLoad first !")
)
; check if DIC is installed
(set #program "DIC")
(P_chkrun)
; in expert mode ask for source drive
(if
(= @user-level 2)
(set #CI_drive
(askstring
(prompt "Select source drive for diskimage(s)")
(default #CI_drive)
(help @askstring-help)
)
)
)
(set @default-dest
(askdir
(prompt ("Where should \"%s\" be installed ?\nA drawer named \"%s\" will automatically be created." @app-name @app-name))
(help @askdir-help)
(default @default-dest)
(disk)
)
)
(set #dest (tackon @default-dest @app-name))
;if anything similar exist delete it
(if
(exists #dest)
(run ("Delete %s %s.info all" #dest #dest))
)
(makedir #dest
(help @makedir-help)
(infos)
)
;----------------------------
(copyfiles
(help @copyfiles-help)
(source ("%s.slave" @app-name))
(dest #dest)
)
(copyfiles
(help @copyfiles-help)
(source ("%s.inf" @app-name ))
(newname ("%s.info" @app-name ))
(dest #dest)
)
(if
(exists #readme-file)
(copyfiles
(help @copyfiles-help)
(source #readme-file)
(dest #dest)
)
)
(if
(exists #readme-file)
(copyfiles
(source ("%s.inf" #readme-file))
(newname ("%s.info" #readme-file))
(dest #dest)
)
)
(set #CI_diskno 1)
(while
(<= #CI_diskno #last-disk)
(
(set #CI_diskname ("%s Disk %ld" @app-name #CI_diskno))
(P_image)
(set #CI_diskno (+ #CI_diskno 1))
)
)
;----------------------------
(run ("Delete %s ALL QUIET FORCE" #cleanup)) ;delete all temporary files
(if
(exists #readme-file)
(if
(= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
("")
(run ("SYS:Utilities/More %s" #readme-file))
)
)
(exit)